package zzcltw.com.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import zzcltw.com.object.Recruit;
import zzcltw.com.service.IRecruitService;


@RestController
public class RecruitController {
	@Autowired
    private IRecruitService recruitService;
	/**
	 * 
	 * @Title getRecruitList
	 * @Description: 招聘列表查询
	 * @param: @param person	
	 * @return void
	 * @throws
	 * @author zzx
	 * @Date 2018年8月15日   上午11:33:17
	 */
	@RequestMapping(value="/getRecruitLIst",method = RequestMethod.POST)
    public Map<String,Object> getRecruitList(String recruitNm,String start,String limit){
		Map<String,String> map = new HashMap<>();
    	map.put("recruitNm", recruitNm);  
    	map.put("start", start);
    	map.put("limit", limit);
    	map.put("validStsCd", "1");
		return recruitService.queryRecruitList(map);
	}
	/**
	 * 
	 * @Title getRecruitDtlById
	 * @Description: 招聘详情
	 * @param: @param person	
	 * @return void
	 * @throws
	 * @author zzx
	 * @Date 2018年8月23日   下午11:33:17
	 */
	@RequestMapping(value="/getRecruitDtlInfo",method = RequestMethod.POST)
    public Map<String,Object> getRecruitDtlById(String recruitId){
		Map<String,String> map = new HashMap<>();
    	map.put("recruitId", recruitId);  
    	map.put("validStsCd", "1");
		return recruitService.queryRecruitDtlById(map);
	}
	/**
	 * 
	 * @Title saveCompanyInfo
	 * @Description: 新增招聘
	 * @param: @param person
	 * @return void
	 * @throws Exception
	 * @author zzx
	 * @Date 2018年8月15日   上午11:33:17
	 */
	@RequestMapping(value="/addRecruitInfo", method=RequestMethod.POST)
    public Map<String,Object> saveRecruitInfo(Recruit recruit) throws Exception { 
		recruit.setCrtUserId("123456789");
		return recruitService.saveRecruitInfo(recruit);  
	}
	/**
	 * 
	 * @Title updateRecruitInfo
	 * @Description: 编辑招聘
	 * @param: @param person
	 * @return void
	 * @throws Exception
	 * @author zzx
	 * @Date 2018年8月15日   上午11:33:17
	 */
	@RequestMapping(value="/updateRecruitInfo", method=RequestMethod.POST)
    public Map<String,Object> updateRecruitInfo(Recruit recruit) throws Exception { 
		recruit.setModfUserId("123456789");
		return recruitService.updateRecruitInfo(recruit);  
	}
	/**
	 * 
	 * @Title delRecruitInfo
	 * @Description: 删除招聘
	 * @param: @param person
	 * @return void
	 * @throws Exception
	 * @author zzx
	 * @Date 2018年8月15日   上午11:33:17
	 */
	@RequestMapping(value="/delRecruitInfo", method=RequestMethod.POST)
    public Map<String,Object> delRecruitInfo(String recruitId) throws Exception { 
		Map<String,String> map = new HashMap<>();
		map.put("recruitId", recruitId);
		return recruitService.delRecruitInfo(map);  
	}	
}
